<template>
  <view>计数: {{ store.count }}</view>
  <view>双倍: {{ store.double }}</view>
  <button @click="increment">加1</button>
  <button @click="decrement">减1</button>
</template>

<script lang="ts" setup>
import { useCounterStore } from '@/stores/counter';
import { ref, computed } from 'vue';

// 初始化 store
const store = useCounterStore();

// 定义 increment 和 decrement 方法
const increment = () => {
  store.increment();
};

const decrement = () => {
  store.decrement();
};
</script>

<style scoped></style>